import {IEvent, IEventHandle} from './EventM';
import {AppTokenTaskService} from '../app-token-task.service';
import {Injectable} from '@angular/core';


@Injectable({
  providedIn: 'root'
})
export class LoginStatusFailureEventHandle implements IEventHandle<LoginStatusFailureEvent> {

  constructor(private appTaskServer: AppTokenTaskService) {
  }

  handle(loginStatusFailureEvent: LoginStatusFailureEvent): void {
    console.log("LoginStatusFailureEventHandle>>>>>", loginStatusFailureEvent);
    this.appTaskServer.stopRefreshTokenTask();

    //throw new Error('Method not implemented.');
  }
}


/**
 * 登录状态失效事件
 */
export class LoginStatusFailureEvent implements IEvent {
  eventType: string = this.constructor.name;
  data: any; // 这里的data可以进一步定义类型
  constructor(data: any) {
    this.data = data;
  }
}
